import { connect } from "./react-redux";

import Hello from "./components/Hello";

function App({ msg, count, dispatch }) {
  console.log("App Render");
  return (
    <div>
      <h1>App</h1>

      <button>MSG: {msg}</button>
      <button
        onClick={() => {
          dispatch({ type: "INCREMENT" });
        }}
      >
        COUNT: {count}
      </button>
      <hr />

      <Hello />
    </div>
  );
}

// eslint-disable-next-line react-refresh/only-export-components
export default connect(
  (state) => ({
    msg: state.msg,
    count: state.count,
  }),
  null
)(App);
